import { Inject, Injectable, InjectionToken } from '@angular/core';
import { BehaviorSubject } from 'rxjs';

export const LANG_CONFIGTOKEN = new InjectionToken<string>('LANG_CONFIGTOKEN');

export const DATA_TOKEN = new InjectionToken<BehaviorSubject<any>>('DATA_TOKEN');


@Injectable({
  providedIn: 'root'
})
export class LangService {

  constructor(
    @Inject(DATA_TOKEN) private data: BehaviorSubject<{
      name: string;
      age: number;
    }>
  ) {
    this.data.next({
      name: 'John',
      age: 30
    });
  }
}


